<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <script>
           function login(){
               var obj=document.getElementById("username");
               console.log(obj.id)
               obj.value="abc";
           }
        </script>
    </head>`
    <body>
        用户名：<input type="text" id="username" placeholder="请输入用户名" />
        <input type="button" value="登录"  onclick="login()"/>
    </body>
</html>
